#set(seoTitle="找回密码")
#@layout()
#define main()
<!-- 内容容器 -->
<div class="wrap" id="wrap">
	<div class="container">
		<div class="row">
			<div class="main clearfix">
			<div class="col-md-6 col-md-offset-3 ptl">
			    <div class="panel panel-default panel-page">
			      <div class="panel-heading"><h2>重设密码</h2></div>
			
			      <form id="password-reset-update-form" class="form-vertical" method="post" novalidate="novalidate" data-widget-cid="widget-0">
			
			         <input id="authCode" type="hidden" value="#(authCode)">
			
			        <div class="form-group">
			          <label class="control-label required" for="form_password">新密码</label>
			          <div class="controls">
			            <input style="width: 90%;margin-left: 10px;" type="password" id="newPassword" name="newPassword" required="required" class="form-control" data-widget-cid="widget-1" data-explain="">
			          <div class="help-block" style="display:none;"></div></div>
			        </div>
			
			        <div class="form-group">
			          <div class="controls">
			              <button type="submit" id="submit_btn" class="btn btn-primary">重设密码</button>
			          </div>
			        </div>
			
			      </form>
			
			    </div><!-- /panel -->
			
			  </div>
			</div>
		</div>
	</div>
</div>
#end

#define js()
	<script type="text/javascript" src="/assets/layer-v3.0.2/layer/layer.js"></script>

	<script type="text/javascript">
		$(document).ready(function() {
			$("#submit_btn").bind("click", function() {
				$.ajax("/login/doRetrievePassword", {
					type: "POST"
					, cache: false
					, dataType: "json"
					, data: { newPassword:  $("#newPassword").val(), authCode:  $("#authCode").val() }
					, beforeSend: function() {
						$("#submit_btn").attr("disabled", true);
					}
					, success: function(ret) {
						layer.msg(ret.msg, {
									shift: ret.isOk ? 0 : 6
									, shade: 0.3
									, time: 0
									, offset: "130px"
									, closeBtn: 1
									, shadeClose: false
									,maxWidth: "1000"
								}, function () {
									if (ret.isOk) {
										location.href = "/login";
									} else {
										$("#submit_btn").attr("disabled", false);
									}
								}
						);
					}
				});
			})
		});
	</script>
#end